import type { RouteRecordRaw } from 'vue-router'

const routes: RouteRecordRaw[] = [
  {
    path: '/',
    redirect: '/home-page',
    component: () => import('../layout/index.vue'),
    children: [
      {
        path: '/home-page',
        name: 'home-page', // 命名路由
        component: () => import('../views/home/index.vue')
      },
      {
        path: '/create-project',
        name: 'create-project', // 命名路由
        component: () => import('../views/project/create-project/index.vue')
      },
      {
        path: '/create-milestone',
        name: 'create-milestone', // 命名路由
        component: () => import('../views/project/create-milestone/index.vue')
      },
      {
        path: '/project-detail',
        name: 'project-detail', // 命名路由
        component: () => import('../views/project/project-detail/index.vue')
      }
    ]
  },

  {
    path: '/404',
    name: '404', // 命名路由
    component: () => import('../views/404/index.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    name: 'any',
    redirect: '/404'
  }
]

export default routes
